package cn.lblbc.downloadlib;

import java.util.List;
import java.util.ArrayList;

/**
 * 下载任务实体类
 */
public class DownloadTask {
    private long taskId;
    private String packageName;
    private long totalSize;
    private long downloadedSize;
    private int status;
    private boolean isWifiOnly;
    private long createTime;
    private long updateTime;
    private String extraInfo;
    private List<DownloadFileInfo> files = new ArrayList<>(); // 初始化为空列表

    public DownloadTask() {
    }

    public long getTaskId() {
        return taskId;
    }

    public void setTaskId(long taskId) {
        this.taskId = taskId;
    }

    public String getPackageName() {
        return packageName;
    }

    public void setPackageName(String packageName) {
        this.packageName = packageName;
    }

    public long getTotalSize() {
        return totalSize;
    }

    public void setTotalSize(long totalSize) {
        this.totalSize = totalSize;
    }

    public long getDownloadedSize() {
        return downloadedSize;
    }

    public void setDownloadedSize(long downloadedSize) {
        this.downloadedSize = downloadedSize;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public boolean isWifiOnly() {
        return isWifiOnly;
    }

    public void setWifiOnly(boolean wifiOnly) {
        isWifiOnly = wifiOnly;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(long updateTime) {
        this.updateTime = updateTime;
    }

    public String getExtraInfo() {
        return extraInfo;
    }

    public void setExtraInfo(String extraInfo) {
        this.extraInfo = extraInfo;
    }

    public List<DownloadFileInfo> getFiles() {
        return files;
    }

    public void setFiles(List<DownloadFileInfo> files) {
        this.files = files != null ? files : new ArrayList<>();
    }
}